﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersonEvents
{
    class PersonTests
    {
        private static void Name_FirstNameChanged(object sender, FirstNameChangedEventArgs eventArgs)
        {
            Console.WriteLine("Imeto na {0} beshe promeneno na {1}", eventArgs.FirstNameOld, eventArgs.FirstNameNew);
        }

        private static void Property_Changed(object sender, PropertyChangedEventArgs eventArgs)
        {
            Console.WriteLine("Property - {0}\nOld Value - {1}\nNew Value - {2}\n", eventArgs.PropertyName, eventArgs.OldValue, eventArgs.NewValue);
        }

        static void Main()
        {
            Person p = new Person("Dimitar", "Dimitrov", "male", DateTime.Now);
            //p.FirstNameChanged += new FirstNameChangedEventHandler(Name_FirstNameChanged);
            //p.FirstName = "Mitko";
            p.propertyChanged += new PropertyChangedEventHandler(Property_Changed);
            //p.propertyChanged += new PropertyChangedEventHandler(Property_Changed);
            p.FirstName = "Mitko";
            //p.LastName = "Mitkov";
            p.Gender = "myj";
            //p.Birthdate = DateTime.Now;
        }
    }
}
